home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM01_B.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  4KB  |  92 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM01_B.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   EMM_installed                                           ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function checks to determine whether EMM is        ;
  7. ;                     installed using the "get interrupt vector" technique    ;
  8. ;                     outlined in the LIM Expanded Memory Specification.      ;
  9. ;                                                                             ;
  10. ;           PASSED:   Nothing.                                                ;
  11. ;                                                                             ;
  12. ;         RETURNED:   status:                                                 ;
  13. ;                        is the status EMM returns from the call.  All other  ;
  14. ;                        returned results are valid only if the status        ;
  15. ;                        returned is zero.  Otherwise they are undefined.     ;
  16. ;                                                                             ;
  17. ; C USE CONVENTION:   unsigned int status;                                    ;
  18. ;                                                                             ;
  19. ;                     status = emm_installed ();                              ;
  20. ;-----------------------------------------------------------------------------;
  21. .XLIST
  22. PAGE    60,132
  23.  
  24. IFDEF SMALL
  25.    .MODEL SMALL, C
  26. ENDIF
  27. IFDEF MEDIUM
  28.    .MODEL MEDIUM, C
  29. ENDIF
  30. IFDEF LARGE
  31.    .MODEL LARGE, C
  32. ENDIF
  33. IFDEF COMPACT
  34.    .MODEL COMPACT, C
  35. ENDIF
  36. IFDEF HUGE
  37.    .MODEL HUGE, C
  38. ENDIF
  39.  
  40. INCLUDE emmlib.equ
  41. INCLUDE emmlib.str
  42. INCLUDE emmlib.mac
  43. .LIST
  44. .CODE
  45. ;-----------------------------------------------------------------------------;
  46. ;                 CONSTANT DATA USED BY THE INTERFACE LIBRARY                 ;
  47. ;-----------------------------------------------------------------------------;
  48.  
  49. EMM_driver_name        DB      'EMMXXXX0'
  50. EMM_DRIVER_NAME_LEN    EQU    ($ - EMM_driver_name)
  51.  
  52. EMM_installed        PROC                                                  \
  53.             USES DS SI DI
  54.  
  55.     ;---------------------------------------------------------------------;
  56.     ;   do;                                                               ;
  57.     ;   .   get the SEGMENT portion of the EMM interrupt vector;          ;
  58.     ;   .   it is needed for the following signature compare;             ;
  59.     ;---------------------------------------------------------------------;
  60.     MOVE        AH:AL, GET_INT_VECTOR:EMM_INT
  61.     INT        DOS_INT
  62.  
  63.     ;---------------------------------------------------------------------;
  64.     ;   .   look for the EMM installation signature in memory;            ;
  65.     ;---------------------------------------------------------------------;
  66.     MOVE        DI,    <OFFSET generic_driver_name>
  67.     MOVE        DS:SI, <OFFSET EMM_driver_name>
  68.     MOVE        CX, EMM_DRIVER_NAME_LEN
  69.     CLD
  70.     REPE        CMPSB
  71.  
  72.     ;---------------------------------------------------------------------;
  73.     ;   .   if (EMM signature not found--EMM is not installed)            ;
  74.     ;   .   .   pseudo EMM status = s/w error;                            ;
  75.     ;   .   else                                                          ;
  76.     ;   .   .   pseudo EMM status = function passed;                      ;
  77.     ;---------------------------------------------------------------------;
  78.     MOVE        AH, software_err_stat
  79.     JNE        EMM_installed_exit
  80.     MOVE        AH, fcn_passed_stat
  81.  
  82. EMM_installed_exit:
  83.     ;---------------------------------------------------------------------;
  84.     ;   .   return (pseudo EMM status);                                   ;
  85.     ;   end;                                                              ;
  86.     ;---------------------------------------------------------------------;
  87.     RET_EMM_STAT    AH
  88.  
  89. EMM_installed        ENDP
  90.  
  91. END
  92.